package com.wei.czz.common.dto.common;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.TreeSet;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wyw
 * date: 2024-01-15 14:41:36
 * className: ChildrenNameValue
 * version: 1.0
 * description:
 */
@Getter
@Setter
@Accessors(chain = true)
public class ChildrenNameValue<T> extends DefaultNameValue<T> implements Comparable<ChildrenNameValue<T>> {

    /**
     * 主键
     */
    private String id;

    /**
     * 父级主键
     */
    private String parentId;

    /**
     * 排序等级
     */
    private Integer sort;

    /**
     * 子列表
     */
    private TreeSet<ChildrenNameValue<T>> children;

    @Override
    public int compareTo(ChildrenNameValue<T> o) {
        return sort.compareTo(o.getSort());
    }
}
